package com.system.util;


import java.io.File;
/**
 * @Classname PathUtils
 * @Description TODO
 * @Date 2023/9/27 0:06
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public class PathUtils {

    public static String getPath(){
        return System.getProperty("user.dir");
    }

    public static File getPathByName(String dictory, String path){
        String p=getPath();
        File file=new File(p+File.separator+dictory);
        if(!file.exists()){
            file.mkdirs();
        }
        return new File(file.getPath()+File.separator+path);
    }



    public static File getPathByName(String path){
        String p=getPath();
        File file=new File(p+File.separator+path);
        if(!file.exists()){
            file.mkdirs();
        }
        return file;
    }


    public static String[] getFilesByName(String name){
        File file=getPathByName(name);
        String [] files=file.list();
        return files;
    }
}
